package com.zzw.basic.classloader;

import java.io.IOException;
import java.net.URL;
import java.util.Enumeration;

public class TestClassLoader {

	public static void main(String[] args) {
		/*ClassLoader c = TestClassLoader.class.getClassLoader();
		System.out.println(c.getSystemClassLoader().toString());
		while(c != null){
			System.out.println(c.getClass().getName());
			c = c.getParent();
		}*/
		ClassLoader loader = ClassLoader.getSystemClassLoader();
		System.out.println("" + loader);
		try {
			Enumeration<URL> em1 = loader.getResources("");
			while(em1.hasMoreElements()){
				System.out.println(em1.nextElement());
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
		
		ClassLoader extentionLoader = loader.getParent();
		System.out.println("" + extentionLoader);
		System.out.println("" + System.getProperty("java.ext.dirs"));
		System.out.println("" + extentionLoader.getParent());
	}
}